home *** CD-ROM | disk | FTP | other *** search
- Path: news.sunquest.com!kitk!kitk
- From: kitk@mudshark.sunquest.com (Kit Kauffmann)
- Newsgroups: comp.lang.c++
- Subject: Re: Could use some help...
- Date: Fri, 1 Mar 1996 11:43:05
- Organization: Sunquest
- Message-ID: <kitk.2116.000BB833@mudshark.sunquest.com>
- References: <4h632q$eij@thor.cmp.ilstu.edu>
- NNTP-Posting-Host: kkauffma.sunquest.com
- X-Newsreader: Trumpet for Windows [Version 1.0 Rev A]
-
- In article <4h632q$eij@thor.cmp.ilstu.edu> edstanf@rs6000.cmp.ilstu.edu (Eric D. Stanfield) writes:
- >From: edstanf@rs6000.cmp.ilstu.edu (Eric D. Stanfield)
- >Subject: Could use some help...
- >Date: 1 Mar 1996 05:48:10 GMT
-
- >Here's my prob:
-
- > void check_board(int [], int [5][5], int [5][5]); // prototype
-
- > // Heres the function:
-
- >void check_board(int bingo_numbers[], int start_numbers[5][5], int
- >new_board[5][5]) {
- > int i, j, x, y, z;
-
- > for(y = 0; y < 5; y++)
- > for(z = 0; z < 5; z++)
- > new_board[y][z] = 0;
-
- > for(i = 0; i < 10; i++)
- > for(j = 0; j < 5; j++)
- > for(x = 0; x < 5; x++)
- > if(bingo_numbers[i] = start_numbers[j][k]) //THIS IS THE PROB
- > new_board[j][k] = -1;
- > else
- > new_board[j][k] = start_numbers[j][k];
- >}
-
- > The problem is that start_numbers[j][k] does not get copied
- >into new_board[j][k]. There are no errors or warnings when I
- >compile it and I've traced both arrays and cant find the reason
- >this is happening. Please post if you can help, I'm under the gun
- >for time. Thanks.
-
- I think this line:
-
- > if(bingo_numbers[i] = start_numbers[j][k]) //THIS IS THE PROB
-
- should read
-
- if(bingo_numbers[i] == start_numbers[j][k]) //THIS IS THE PROB
-
- Notice the == (compare) instead of = (assign)
-
- HTH!
-
-
- Kit Kauffmann - kitk@mudshark.sunquest.com
- AKA 73363,447 (Compu$erve)
-
- Finger me for my public key
-